package com.htgd.gardenexpo.dao;

import com.htgd.gardenexpo.entity.GeBaseDepart;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 组织机构表 Mapper 接口
 * </p>
 *
 * @author author
 * @since 2024-03-01
 */
@Mapper
public interface GeBaseDepartDao extends BaseMapper<GeBaseDepart> {
@Delete("DELETE FROM  `ge_base_depart_before`")
    void removeBefore();
@Select("INSERT INTO \n" +
        "ge_base_depart_before(id,parent_id,depart_name,depart_order,org_type,org_code,status,del_flag,create_by,create_time,update_time,iz_leaf,fzr,fzr_id) \n" +
        "VALUES(#{id},#{parentId},#{departName},#{departOrder},#{orgType},#{orgCode},#{status},#{delFlag},#{createBy},#{createTime},#{updateTime},#{izLeaf},#{fzr},#{fzrId})")
    void insertBefore(GeBaseDepart geBaseDepart);
@Select("SELECT * FROM  `ge_base_depart_before`")
    List<GeBaseDepart> getBeforeList();
@Select("SELECT * FROM  `ge_base_depart_before` WHERE id =#{id}")
    GeBaseDepart getBeforeById(String id);
}
